load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "current",
    srcs = [
        "dep_add_column.go",
        "dep_add_constraint.go",
        "dep_add_index.go",
        "dep_add_index_and_column.go",
        "dep_add_index_and_constraint.go",
        "dep_alter_column_type.go",
        "dep_create.go",
        "dep_create_function.go",
        "dep_drop_column.go",
        "dep_drop_constraint.go",
        "dep_drop_index.go",
        "dep_drop_index_and_column.go",
        "dep_drop_object.go",
        "dep_garbage_collection.go",
        "dep_swap_index.go",
        "dep_two_version.go",
        "helpers.go",
        "registry.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules/current",
    visibility = ["//pkg/sql/schemachanger/scplan:__subpackages__"],
    deps = [
        "//pkg/clusterversion",
        "//pkg/sql/schemachanger/rel",
        "//pkg/sql/schemachanger/scpb",
        "//pkg/sql/schemachanger/scplan/internal/opgen",
        "//pkg/sql/schemachanger/scplan/internal/rules",
        "//pkg/sql/schemachanger/scplan/internal/scgraph",
        "//pkg/sql/schemachanger/screl",
        "//pkg/sql/sem/catid",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "current_test",
    srcs = [
        "assertions_test.go",
        "rules_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":current"],
    deps = [
        "//pkg/sql/catalog/catpb",
        "//pkg/sql/schemachanger/rel",
        "//pkg/sql/schemachanger/scpb",
        "//pkg/sql/schemachanger/scplan/internal/opgen",
        "//pkg/sql/schemachanger/screl",
        "//pkg/sql/types",
        "//pkg/testutils/datapathutils",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
        "@in_gopkg_yaml_v3//:yaml_v3",
    ],
)
